<?php
class Web_Action_Helper_BaseInit 
    extends Zend_Controller_Action_Helper_Abstract
{
	
	public function predispatch()
	{
		return $this->baseInit();
	}
	
	public function baseInit()
	{
		$session 	= Zend_Registry::get('session');
		$controller = $this->getActionController();
		$request	= $this->getRequest();
		$config		= Zend_Registry::get('configuration');
		
		$controller->lang		 	= $config->language;
		$controller->system		 	= $config->system;
		
		$controller->view->system		= $config->system;
		$controller->view->session		= $session;
		
		$controller->view->facebookAppId = $config->facebook->appId;
		$controller->view->facebookLang  = $config->facebook->api->lang;
		
//		$controller->view->googleMapsKey = $config->google->maps->key;
		
		$controller->view->googleAnalyticsTrack = $config->google->analytics->track;
		$controller->view->googleAnalyticsKey = $config->google->analytics->key;
		$controller->view->googleAnalyticsDomain = $config->google->analytics->domain;
		
		$controller->view->googlePicasaUserId = $config->google->picasa->userId;

		$controller->view->lang = $config->language;
		$controller->view->enviroment = getenv('APPLICATION_ENV');
		$controller->view->countryCode = $config->country->code;
		$controller->view->countryName = $config->country->name;
		
		$controller->view->loginForm = new Web_Form_Login;
		$controller->view->loginForm->setAction(		
			$controller->getHelper('Url')->url(array('controller' =>'authentication','action' =>'authenticate'))
		);
		
		$controller->view->forgotForm = new Web_Form_Email;
		$controller->view->forgotForm->setAction(	
			$controller->getHelper('Url')->url(array('controller' =>'authentication','action' =>'authenticate'))
		);
		
		Zend_Registry::set( "now", Zend_Date::now());
		
		
		
		$mapperC = Vs_Factory::mapper('Category');
		 
		$controller->view->categories = $mapperC->getByParams();
		
	}

	

}